<div class="col-md-4" data-id="<%= portfolio_item.id %>">
  <div class="card mb-4 box-shadow">
    <%= link_to portfolio_show_path(portfolio_item.id) do %>
    <%= image_tag portfolio_img(portfolio_item.thumb_image.to_s, "thumb"), width: "100%", height: "100%" %>
    <% end %>
    <div class="card-body">
      <p class="card-text">
        <span><%= portfolio_item.title %></span> |
        <span><%= portfolio_item.subtitle %></span>
      </p>
      <div class="d-flex justify-content-between align-items-center">
        <div class="btn-group">
          <%= link_to "View", portfolio_show_path(portfolio_item.id), class: "btn btn-sm btn-outline-secondary"  %>
          <% if logged_in?(:site_admin) %>
          <%= link_to "Edit", edit_portfolio_path(portfolio_item.id), class: "btn btn-sm btn-outline-secondary" %>
          <%= link_to "Delete", portfolio_path(portfolio_item.id), method: :delete, data: { confirm: 'Are you sure want to delete this portfolio item?' }, class: "btn btn-sm btn-outline-danger" %>
          <% end %>
        </div>
        <small class="text-muted"><%= distance_of_time_in_words(portfolio_item.created_at, Time.now) %> ago</small>
      </div>
    </div>
  </div>
</div>